package bupt.com.test.config;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

/**
 * Created by wyf on 2016/7/18.
 */
public class Constant {
    //http://182.18.31.162:21580/csapp/CSAPP/
//    public static final String HOST_URL = "http://192.168.10.253:8080/";//http://192.168.10.253:8080/csapp/CSAPP/
    public static final String HOST_URL = "http://192.168.10.72:8080/";
    public static final String url = HOST_URL + "csapp/CSAPP/";
    public static final String getFirstVideo = url + "getFirstVideo.action";
    public static final String getProgramByFirstVideoId = url + "getProgramByFirstVideoId.action";
    public static final String updatePicture = url+ "updatePicture.action";
    public static final String getProgramEpisodesNumberByProgramId = url + "getProgramEpisodesNumberByProgramId.action";
    public static final String getProgramByProgramIdFirst = url +"getProgramByProgramIdFirst.action";
    public static final String getChannelInfoByPage = url + "getChannelInfoByPage.action";
    public static final String getProgramByProgramIdAndEpisodesNumber = url + "getProgramByProgramIdAndEpisodesNumber.action";
    /* 连接超时时长 */
    public static final int CONNECT_TIMEOUT = 60 * 1000;

    /* 读取超时时长 */
    public static final int READ_TIMEOUT = 6000 * 1000;

    public static Object parseData(String data, Gson gson, TypeToken typeToken) {
        return gson.fromJson(data, typeToken.getType());
    }
}
